package com.whmskj.xjlhsc.qianYiData.mapper;

import com.whmskj.xjlhsc.qianYiData.dto.ProcessRunStatsRow;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface ProcessRunStatsMapper {
    int updateStats();
    int insertMissingStats();

    List<ProcessRunStatsRow> selectCurrentStats();
    List<ProcessRunStatsRow> selectComputedStats();

    // 动态班次运转率（写入/查询）
    int updateRunRateByShift(@Param("shiftStart") Date shiftStart,
                             @Param("shiftEnd") Date shiftEnd,
                             @Param("now") Date now);

    List<ProcessRunStatsRow> selectRunRateByShift(@Param("shiftStart") Date shiftStart,
                                                  @Param("shiftEnd") Date shiftEnd,
                                                  @Param("now") Date now);
}

